package com.syni.mdd.sjb.marketing.basemarket.entity.vo.responseVo;

import com.syni.mdd.sjb.common.component.utils.common.constants.Constants;
import lombok.Data;

@Data
public class RpVo {
    private Integer pageSize = 1;
    private Integer pageNum = 100;
    private Integer isLastPage = 1;
    private Integer count = 0;

    public void pageParamCal(Integer pageNum,Integer pageSize,Integer count){
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.count = count;
        Integer num = (int)Math.ceil((double)count / pageSize);
        if(num.equals(Constants.COMMON_FLAG_FALSE_INT)){
            isLastPage = Constants.COMMON_FLAG_TRUE_INT;
        } else if(!pageNum.equals(num)){
            isLastPage = Constants.COMMON_FLAG_FALSE_INT;
        }

    }
}
